package com.zyy.study.jdk8NewFeatures;

import lombok.SneakyThrows;

import java.util.concurrent.TimeUnit;

public class TransactionTask {
    private int transactionId;
    public TransactionTask() {
    }

    public TransactionTask(int transactionId) {
        this.transactionId = transactionId;
    }

    @SneakyThrows
    public String doTransaction()  {
        TimeUnit.SECONDS.sleep(1);
        return this.toString();
    }

    @Override
    public String toString() {
        return "TransactionTask{" +
                "transactionId=" + transactionId +
                '}';
    }
}
